#pragma once

class SeatImpl;
class Seat;
class CLabPluginView;
class CLayoutManagerWnd;
class CWM2MP3Wnd;
class CWorkflowWnd;
class CMainFrame;
class TestNumber;

#include <vector>
using namespace std;
class SeatManager
{
public:
	static BOOL LoadSeat();
	static BOOL BuildLayout( CWnd* pParentWnd);
	static BOOL RestoreLayout();

	static void HookRelayEvent( MSG* pMsg );
	static bool ResetRange(CRect rect);
	static bool ResetRange();
	static void RemoveGroupStudent(int nGroup);

	static void RemoveAllStudent();
	static BOOL RefreshWorkPanel();
	static BOOL ArrangeSeats();

	static BOOL SetLabPluginView(CLabPluginView* pCLabPluginView);
	static BOOL SetLayoutManagerWnd(CLayoutManagerWnd* pCLayoutManagerWnd);
	static BOOL SetWM2MP3Wnd(CWM2MP3Wnd* pCWM2MP3Wnd);
	static BOOL SetWorkflowWnd(CWorkflowWnd* pCWorkflowWnd);
	static BOOL SetMainFrame(CMainFrame* pCMainFrame);

	static CLabPluginView* GetLabPluginView();
	static CLayoutManagerWnd*  GetLayoutManagerWnd();
	static CWM2MP3Wnd* GetWM2MP3Wnd();
	static CWorkflowWnd*  GetWorkflowWnd();
	static BOOL CloseLayoutSide();
	static BOOL DiscloseWM2MP3Wnd();
	static BOOL AddJobs();
	static BOOL AddJob(const CString& source,const CString& destination);
	static int HasMoreJobs();
	static BOOL StartMonitor(const CString& AudioSource);
	static BOOL ResetInitTestNumber(int nGroup,TestNumber* pNewInitTestNUmber);
	static BOOL CheckResetTestNumber(int nGroup,TestNumber* pNewInitTestNUmber);

	static BOOL CheckNextTestNumber();
	static BOOL NextTestNumber();
	static BOOL DeleteSourceFiles();
	static BOOL StartTest();
	static BOOL StartConverting();
	static BOOL CheckFiles();

	static vector<vector<Seat*> >& GetSeatLayout();
	static CSize GetLayoutSize();

	static void BackToNormalMode();
	static void RefreshUI(TOperationMode TOperationMode);
protected:
	static SeatManager& GetInstance();
	SeatManager(void);
	~SeatManager(void);
	
	static void ReleaseSeatImpl();
	static BOOL ReleaseSeatLayout();

	
private:
	std::vector<SeatImpl*> vSeatImpl;
	vector<vector<Seat*> > vSeatLayout;

	CLabPluginView* pCLabPluginView;
	CLayoutManagerWnd* pCLayoutManagerWnd;
	CWM2MP3Wnd* pCWM2MP3Wnd;
	CWorkflowWnd* pCWorkflowWnd;
	CMainFrame* pCMainFrame;
};
